import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @作者: xiaoxun
 * @日期: 2025/3/13 12:46
 * @描述:
 */
@Data
@AllArgsConstructor
@NoArgsConstructor

public class Account {
	private String carId;
	private double money;
	public void darMoner(double money){
		String name=Thread.currentThread().getName();
		if(this.money>=money){
			System.out.println(name+"取钱成功，取出："+money);
			//更新余额
			this.money-=money;
			System.out.println(name+"账户余额为："+this.money);
		}else {
			System.out.println(name+"余额不足！");
		}
	}
}

